package com.rabbit.logisticsservice.listen;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class LogisListener {

//    @RabbitListener(queues = "order_queue")
//    public void logisListener(Message message) {
//        String messageBody = new String(message.getBody());
//        System.out.println("我是物流系统，收到消息"+messageBody);
//    }

//    @RabbitHandler
    @RabbitListener(queues = "order_queue")
    public void logisListener2(Message message) {
        String messageBody = new String(message.getBody());
        System.out.println("我是物流系统，收到消息"+messageBody);
    }
}
